<#-- List execute.data, only the top element is shown -->
<@cs.include page="/viewTemplate/list.htm">
	<@cs.extends target="/style">
		<#if ps.css?exists>@import "${ps.css}"</#if>
	</@cs.extends>
	
	<@cs.extends target="listPagination1">
		<#if (execute?exists) && (execute.data.size()>0)>
			<@cs.pageInfoTag pageInfo="execute" url="${fn.link(ps.targetAction)}?" />
		</#if>
	</@cs.extends>
	
	<@cs.extends name="listHeader" target="//table//thead">
		<#if (execute?exists) && (execute.data.size()>0)>
		   	<tr>
		   		<#-- id column -->
		   		<th></th>
		   		<#-- field columns -->
			   	<#assign pageElement = ps.getElement('execute.data[0]')>
			   	<#list pageElement.visibleElements as element>
			   		<#if element.isElement()>
			       		<th scope="col"><@s.text name="${element.label}"/></th>
			       	</#if>
				</#list>
				<#-- operation column -->
				<th></th>
			</tr>
		</#if>
	</@cs.extends>

	<@cs.extends name="listDetail" target="//table//tbody">
		<#if (execute?exists) && (execute.data.size()>0)>
			<#assign pageElement = ps.getElement('execute.data[0]')>
			<#list execute.data as data>
			${stack.push(data)}
			<tr>
				<@cs.mark name="listId">
					<td class="listId"><@s.property value="id"/></td>
				</@cs.mark>
				
				<@cs.mark name="listField">
					<#list pageElement.visibleElements as element>
					<#if element.isElement()>
						<td class="listField">
							<@cs.element name="${element.name}" theme="simple"/>
						</td>
					</#if>
					</#list>
				</@cs.mark>
				
				<@cs.mark name="listButton">
					<td class="listButton">
						<@s.a href="${fn.link(ps.action('view'), 'model.id=' + data.id)}"><@s.text name="action.view"/></@s.a>&nbsp;
						<@s.a href="${fn.link(ps.action('_update'), 'model.id=' + data.id)}"><@s.text name="action.update"/></@s.a>&nbsp;
						<@s.a href="${fn.link(ps.action('delete'), 'model.id=' + data.id)}"><@s.text name="action.delete"/></@s.a>
					</td>
				</@cs.mark>
			</tr>
			<#assign temp = stack.pop()>
			</#list>
		<#else>
			<tr><td class="listNoResult"><@s.text name="generic.noResult"/></td></tr>
		</#if>
	</@cs.extends>
	
	<@cs.extends target="listPagination2">
		<#if (execute?exists) && (execute.data.size()>0)>
			<@cs.pageInfoTag pageInfo="execute" url="${fn.link(ps.targetAction)}?" />
		</#if>
	</@cs.extends>
</@cs.include>